.class public abstract Lcom/hierynomus/smbj/transport/a;
.super Ljava/lang/Object;
.source "BaseTransport.java"

# interfaces
.implements Lcom/hierynomus/smbj/transport/d;


# instance fields
.field protected a:Ljava/io/InputStream;

.field protected b:Ljava/io/OutputStream;

.field private final c:Ljava/util/concurrent/locks/ReentrantLock;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ljava/util/concurrent/locks/ReentrantLock;

    invoke-direct {v0}, Ljava/util/concurrent/locks/ReentrantLock;-><init>()V

    iput-object v0, p0, Lcom/hierynomus/smbj/transport/a;->c:Ljava/util/concurrent/locks/ReentrantLock;

    return-void
.end method


# virtual methods
.method protected abstract a(Lcom/hierynomus/smbj/common/b;)V
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation
.end method

.method public a(Lcom/hierynomus/smbj/smb2/d;)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/smbj/transport/TransportException;
        }
    .end annotation

    .line 3
    iget-object v0, p0, Lcom/hierynomus/smbj/transport/a;->c:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V

    .line 4
    :try_start_0
    new-instance v0, Lcom/hierynomus/smbj/common/b;

    invoke-direct {v0}, Lcom/hierynomus/smbj/common/b;-><init>()V

    .line 5
    invoke-virtual {p1, v0}, Lcom/hierynomus/smbj/smb2/d;->c(Lcom/hierynomus/smbj/common/b;)V

    .line 6
    invoke-virtual {p0, v0}, Lcom/hierynomus/smbj/transport/a;->a(Lcom/hierynomus/smbj/common/b;)V

    .line 7
    iget-object p1, p0, Lcom/hierynomus/smbj/transport/a;->b:Ljava/io/OutputStream;

    invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 8
    iget-object p1, p0, Lcom/hierynomus/smbj/transport/a;->c:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V

    return-void

    :catchall_0
    move-exception p1

    goto :goto_0

    :catch_0
    move-exception p1

    .line 9
    :try_start_1
    new-instance v0, Lcom/hierynomus/smbj/transport/TransportException;

    invoke-direct {v0, p1}, Lcom/hierynomus/smbj/transport/TransportException;-><init>(Ljava/lang/Throwable;)V

    throw v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 10
    :goto_0
    iget-object v0, p0, Lcom/hierynomus/smbj/transport/a;->c:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V

    .line 11
    throw p1
.end method

.method public a(Ljava/io/InputStream;Ljava/io/OutputStream;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/hierynomus/smbj/transport/a;->a:Ljava/io/InputStream;

    .line 2
    iput-object p2, p0, Lcom/hierynomus/smbj/transport/a;->b:Ljava/io/OutputStream;

    return-void
.end method
